<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="./js/vue.global.js"></script>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      list-style: none;
    }

    #app {
      padding: 20px;
      transform: translateY(5vh) rotate(90deg);
    }

    ul {
      display: flex;
      justify-content: space-around;
      width: 90vh;
      transform: translateX(5vh);
    }

    ul + ul {
      margin-top: 20px;
    }

    li {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      color: white;
      background: blue;
      text-align: center;
      line-height: 30px;
    }

    .red {
      background: red;
    }

    #app {

    }

  </style>
</head>
<body>
<div id="app">
  <ul v-for="it in five">
    <li class="red" v-for="item of it.red_balls">
      {{item}}
    </li>
    <li>{{it.blue_ball}}</li>
  </ul>
</div>
<script>
  const { createApp, ref } = Vue

  function random(num) {
    return parseInt(Math.floor(Math.random() * (num + 1)))
  }

  createApp({
    setup() {
      let five = ref([])
      for (let i = 0; i < 5; i++) {
        let item = {
          red_balls: []
        }
        for (let i = 0; i < 6; i++) {
          let n = random(31)
          while (n == 0) {
            n = random(31)
          }

          if (item.red_balls.indexOf(n) == -1) {

            item.red_balls.push(n)
          } else {
            let n = random(31)
            while (n == 0) {
              n = random(31)
            }
            item.red_balls.push(n)
          }
        }

        item.red_balls.sort((a, b) => {
          return a > b ? 1 : -1
        })
        let m = random(17)
        while(m == 0){
          m = random(17)
        }
        item.blue_ball = m
        five.value.push(item)
      }

      return {
        five
      }
    }
  }).mount('#app')
</script>
</body>
</html>